<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018-09-22
 * Time: 11:48
 */

namespace App\ServiceHandler\Common;


use App\Model\Backstage\Department;

class DepartmentService
{
    public static function getByType($type)
    {
        $department = new Department();
        if ($type == 4) {
            $list = $department->getAllDropdown();
        } elseif ($type == 3) {
            $list = $department->getInterPartDropdown();
        } elseif ($type == 2) {
            $list = $department->getHeadquartersDropdown();
        }elseif ($type == 1) {
            $list = $department->getHeadquartersDropdown();
        }
        if (sizeof($list) == 0) {
            return false;
        }
        return $list;
    }

}